/*
 * DbHttpUserStore.h
 *
 *  Created on: 2018年2月9日
 *      Author: terry
 */

#ifndef DBHTTPUSERSTORE_H_
#define DBHTTPUSERSTORE_H_

#include "HttpTokenAuth.h"
#include "SharedPtr.h"
#include "CHttpUserStore.h"
#include "DataStore.h"

class DbHttpUserStore: public CHttpUserStore
{
public:
	explicit DbHttpUserStore(std::shared_ptr< DataStore >& dbStore);
	virtual ~DbHttpUserStore();

	void setDb(std::shared_ptr< DataStore >& dbStore);

	virtual bool findUser(const std::string& username, HttpUser& user);

protected:
	bool findDb(const std::string& username, HttpUser& user);

protected:
	std::shared_ptr< DataStore > m_dbStore;

};

#endif /* DBHTTPUSERSTORE_H_ */
